<template>
  <div id="me">
    {{count}}
    <mt-button @click="jiaPlus" type="primary" size="small">+</mt-button>
    <mt-button @click="jianPlus" type="default" size="small">-</mt-button>
    <mt-button @click="jiaA" type="default" size="small">A</mt-button>
    <ul><li v-for="(item,index) in images" :key="index">{{item}}</li></ul>
    <mt-button @click="submit" type="default" size="small">A</mt-button>
  </div>
</template>

<script>
  import {mapState, mapGetters,mapMutations,mapActions } from 'vuex'

  export default {
    name: "me",
    data() {
      return {
        counte: 0
      }
    },
    mounted(){
      let vm = this;
      vm.getImages();
      console.log(this.$store)
    },
    computed: {
      ...mapState(['count','images']),
      // ...mapGetters(['jia'])
      count(){
        return this.$store.getters.jia;
      }
    },
    methods:{
      ...mapMutations(['jiaPlus','jianPlus']),
      ...mapActions(['jiaA','getImages','submitAc']),
      submit:function(){
        let data = {
          a:1,
          b:2,
          c:3
        }
        this.submitAc(data);
      }
    }
  }
</script>

<style scoped>

</style>
